package com.atguigu.spring6.iocxml;

import com.atguigu.spring6.iocxml.bean.UserDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author: Michael
 * @date: 2025/5/13
 * @desc:
 */
public class TestUserDao {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");

        // 根据类型获取接口对应的bean
        UserDao userDao = context.getBean(UserDao.class);
        System.out.println("根据类型获取接口对应的bean: " + userDao);
        userDao.run();
    }
}
